- Notifications
You must be signed in to change notification settings - Fork 5.8k
/
Copy path274. H-Index_test.go
56 lines (45 loc) · 764 Bytes
/
274. H-Index_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package leetcode
import (
"fmt"
"testing"
)
typequestion274struct {
para274
ans274
}
// para 是参数
// one 代表第一个参数
typepara274struct {
one []int
}
// ans 是答案
// one 代表第一个答案
typeans274struct {
oneint
}
funcTest_Problem274(t*testing.T) {
qs:= []question274{
{
para274{[]int{3, 6, 9, 1}},
ans274{3},
},
{
para274{[]int{1}},
ans274{1},
},
{
para274{[]int{}},
ans274{0},
},
{
para274{[]int{3, 0, 6, 1, 5}},
ans274{3},
},
}
fmt.Printf("------------------------Leetcode Problem 274------------------------\n")
for_, q:=rangeqs {
_, p:=q.ans274, q.para274
fmt.Printf("【input】:%v 【output】:%v\n", p, hIndex(p.one))
}
fmt.Printf("\n\n\n")
}